<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/jsp/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>收银记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="${ctxStatic}/plugins/h+/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/animate.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/plugins/h+/css/plugins/webuploader/webuploader.css">
    <link href="${ctxStatic}/plugins/h+/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <style>
        .ml10 {
            margin-left: 15px;
        }

    </style>

</head>

<body class="gray-bg" >
<div class="wrapper wrapper-content" id="ccbb">
    <div class="row">
        <div class="col-sm-12">
            <%--<div class="toolbar">--%>
                <%--<div id="toolbar">--%>
                    <%--<button id="btn_add" class="btn btn-primary"><i class="fa fa-plus-circle"></i>&nbsp;新增</button>--%>
                    <%--<button id="btn_del" class="btn btn-w-s btn-danger"><i class="fa fa-times-circle"></i>&nbsp;批量删除</button>--%>
                    <%--<button id="button" class="btn btn-primary " ><i class="fa fa-check-circle"></i>&nbsp;获取选中</button>--%>
                    <%--<button id="btn_getCheck姓名" class="btn btn-primary " ><i class="fa fa-check-square"></i>&nbsp;获取选中ChekBox</button>--%>
                <%--</div>--%>
            <%--</div>--%>
            <span id="spancc" class="spancc"></span>
            <div class="row">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>搜索条件</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content" >
                        <div class="row">
                            <div class="col-sm-4"><input placeholder="手机号或订单号" class="form-control" id="phoneOrOrderCode"></div>
                            <div class="col-sm-2">
                                <select class="form-control" id="state">
                                    <option value="1">已付款</option>
                                    <option value="2">已退款</option>
                                    <option value="3">错误订单</option>
                                </select>
                            </div>
                            <div class="col-sm-2"><input placeholder="开始日期" id="dateStart" class="form-control layer-date" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" id="start"></div>
                            <div class="col-sm-2"><input placeholder="结束日期" id="dateEnd" class="form-control layer-date" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" id="end"></div>
                            <div class="col-sm-1"><button id="btn_search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;搜索</button></div>

                        </div>
                    </div>
                </div>
            </div>
            <table id="exampleTablePagination" class="table table-striped table-bordered table-hover"></table>
        </div>
    </div>
</div>

<script src="${ctxStatic}/plugins/h+/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctxStatic}/plugins/h+/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/bootstrap-table-master/bootstrap-table.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/bootstrap-table-master/locale/bootstrap-table-zh-CN.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/bootstrap-table-master/extensions/export/bootstrap-table-export.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/bootstrap-table-master/extensions/editable/bootstrap-table-editable.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/content.min.js?v=1.0.0"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/layer/laydate/laydate.js"></script>
<script>

</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script type="text/javascript">
    //初始化表格对象
    var $table = $('#exampleTablePagination');

    $table.bootstrapTable({
        url: "${pageContext.request.contextPath}/QTMain/queryMoney.ac",
        method: 'post',
        contentType: "application/x-www-form-urlencoded",//必须的
        dataType: "json",
        pageList:[10],//会根据当前的数据量加载合适的pageList
        height: ($(window).height()) ,
        //cardView:true,//是否自适应手机
        pagination: true, //分页
        // queryParamsType: "limit",
        singleSelect: false,
        cache:false,
        sortName:"createTime",
        search: false, //显示搜索框
        showColumns:false,
        showRefresh:false,
        showToggle:false,
        showPaginationSwitch:false,
        smartDisplay:true,
        detailView:false,
        toolbar:"#toolbar",
        queryParams: queryParams,//参数
        searchOnEnterKey:true,
//        detailFormatter:function(index, row, element){
//            return row.notes;
//        },
        sidePagination: "server", //服务端处理分页
        columns: [
//            {
//                visible:false,
//                field:'id'
//            },
//            {
//                title:'选择',
//                align:'center',
////                    formatter:stateFormatter,
//                checkbox:true
//            },
            {
                title: '订单号',
                field: 'code',
//                    titleTooltip: '点击可以进行排序操作',
//                    sortStable:true,
                align: 'center'
            },
            {
                title: '客户',
                field: 'custom_name',
                align: 'center'
            },
            {
                title: '收银员',
                field: 'person_name',
//                    sortStable:true,
                align: 'center'
            },
            {
//                付款途径：0.余额支付 1.银联支付 2.支付宝支付 3.微信支付 4.兴业银行微信支付,6.翼支付，7.offline线下支付
                title: '支付方式',
                field: 'trade_type',
                align: 'center',
                formatter:function(value,row,index){
                   if(value=="MICROPAY"){
                       return "刷卡支付";
                   }else if(value=="NATIVE"){
                       return "扫码支付";
                   }else if(value=="JSAPI"){
                       return "公众号支付";
                   }else if(value=="offline"){
                       return "线下支付";
                   }else if(value=="UNIONPAY"){
                       return "银联支付";
                   }else if(value=="ZFB-MICROPAY"){
                       return "支付宝支付";
                   }
                }
            },
            {
                title: '用贝额',
                field: 'coinPayTotal',
                align: 'center'
            },
            {
                title: '用券额',
                field: 'payCoupon',
                align: 'center'
            },
            {
                title: '服务费',
                field: 'cash_total',
                align: 'center'
            },
            {
                title: '交易时间',
                field: 'create_time',
//                    sortStable:true,
                align: 'center',
//                formatter:function(value,row,index){
//                    var d = new Date(value.time);
//                    var month = parseInt(d.getMonth()) + 1;
//                    var str = d.getFullYear() + "-" + month + "-" + d.getDate() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();
////                    console.log(str);
//
//                    return str;
//                }
            },
//            {
//                title: '操作',
//                align: 'center',
//                events:{
//                    'click .edit': function (e, value, row, index) {
//                        //弹出编辑层
////                            alert('You click like icon, row: ' + JSON.stringify(value));
//                        showPopup(1,row.id);
//                    },
//                    'click .remove': function (e, value, row, index) {
//                        var arr=[row.id];
//                        deleteGrid(arr);
//                    }
//                },
//                formatter:function(value,row,index){
//                    return [
//                        '<a class="edit ml10" href="javascript:void(0)" title="编辑">',
//                        '<i class="glyphicon glyphicon-edit"></i>',
//                        '</a>',
//                        '<a class="remove ml10" href="javascript:void(0)" title="删除">',
//                        '<i class="glyphicon glyphicon-remove"></i>',
//                        '</a>'
//                    ].join('');
//                }
//            }
        ]
    });

    /*
     搜索按钮
     */
    $("#btn_search").click(function(){
        $table.bootstrapTable('selectPage', 1);
        $table.bootstrapTable('refresh', queryParams);
    });

    /*
     传递的参数
     */
    function queryParams(params) {
        var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            limit: params.limit,  //页面大小
            page: params.offset, //页码
            pageindex:params.pageNumber,
            telephone: $("#phoneOrOrderCode").val(),
            orderCode: $("#phoneOrOrderCode").val(),
            dateStart: $("#dateStart").val(),
            dateEnd: $("#dateEnd").val(),
            state: $("#state").val(),
        };
        return temp;
    }
    ///////////////////////////////////////////////////////////////toolbar///////////////////////////////////////


</script>
</body>


</html>
